package com.quan.demo.constant;

public interface CommonConstant {
    public static enum QueryClassify {
        platform("platform", "平台的"),
        organization("organization", "本机构的"),
        own("own", "自己的");
        private String id;
        private String name;

        QueryClassify(String id, String name) {
            this.id = id;
            this.name = name;
        }

        public String getId() {
            return id;
        }

        public String getName() {
            return name;
        }

        public static String getNameById(String id) {
            for (QueryClassify _enmu : QueryClassify.values()) {
                if (_enmu.id.equals(id)) {
                    return _enmu.getName();
                }
            }
            return null;
        }

        public static String getIdByName(String name) {
            for (QueryClassify _enmu : QueryClassify.values()) {
                if (_enmu.name.equals(name)) {
                    return _enmu.getId();
                }
            }
            return null;
        }
    }
}
